;; 配置Common Lisp

;; SLIME 配置
(add-to-list 'load-path "~/.emacs.d/lisp/slime-2011-11-09/")  ; your SLIME directory
(setq inferior-lisp-program "sbcl") ; your Lisp system
(require 'slime)
(slime-setup '(slime-fancy))

(add-hook 'lisp-mode-hook '(lambda ()
			     (local-set-key (kbd "RET") 'newline-and-indent)))

(defun lisp-indent-or-complete (&optional arg)
  (interactive "p")
  (if (or (looking-back "^\\s-*") (bolp))
      (call-interactively 'lisp-indent-line)
    (call-interactively 'slime-indent-and-complete-symbol)))
(eval-after-load "lisp-mode"
  '(progn
     (define-key lisp-mode-map (kbd "TAB") 'lisp-indent-or-complete)))

;; auto-complete-mode slime补齐
(add-hook 'slime-mode-hook 'set-up-slime-ac)
(add-hook 'slime-repl-mode-hook 'set-up-slime-ac)
(eval-after-load "auto-complete"
  '(add-to-list 'ac-modes 'slime-repl-mode))

(provide 'jerry-cl)
